package com.eflow.model.e;

import lombok.Getter;

/**
 * @author : bruce.liu
 * @title: : CommentTypeEnum
 * @projectName : flowable
 * @description: 审批意见的类型
 * @date : 2019/11/2412:53
 */
public enum CommentTypeEnum {
    /**
     * 提交
     */
    SUBMIT(0,"提交"),
    /**
     * 审批
     */
    APPROVE(1,"审批"),
    /**
     * 驳回
     */
    RETURN(2,"驳回"),
    /**
     * 撤回
     */
    ADMIN(3,"系统流转"),
    /**
     * 督办
     */
    URGE(4,"督办"),
    /**
     * 转办
     */
    TURN_TODO(5,"转办"),
    /**
     * 转办
     */
    DELEGATE(6,"委派"),
    /**
     * 撤回
     */
    BACK(7,"撤回");



    @Getter
    private int code;
    @Getter
    private String name;

    /**
     * 通过code获取Msg
     *
     * @param code
     * @return
     * @Description:
     */
    public static String getEnumMsgByCode(int code) {
        for (CommentTypeEnum e : CommentTypeEnum.values()) {
            if (e.code == code) {
                return e.name;
            }
        }
        return "";
    }
    private CommentTypeEnum( int code,String name) {
        this.code = code;
        this.name = name;
    }

}
